public class Notes.window : Gtk.ApplicationWindow
{
    public Settings settings;
    public window(Application app)
    {
        Object(
            application: app
        );
    }
    construct
    {
        title = "Hello world!";
        window_position = Gtk.WindowPosition.CENTER;
        set_default_size(350, 250);

        settings = new Settings("Extra");

        move(settings.get_int("x"), settings.get_int("y"));
        resize(settings.get_int("width"), settings.get_int("height"));

        delete_event.connect(e => {
            return before_destroy();
        });

        var headerbar = new Notes.HeaderBar();
        set_titlebar(headerbar);

        show_all();
    }
    public bool before_destroy()
    {
        int width, height, x, y;

        get_size(out width, out height);
        get_position(out x, out y);
        settings.set_int("x", x);
        settings.set_int("y", y);
        settings.set_int("width", width);
        settings.set_int("height", height);

        return false;
    }
}
